package com.pretty.test.controller.system.webinfo;


import com.baomidou.mybatisplus.extension.api.R;
import com.pretty.test.controller.system.webinfo.vo.WebInfoVO;
import com.pretty.test.entity.PetsWebInfo;
import com.pretty.test.service.IPetsWebInfoService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * 本站信息控制器
 * @author dujianyu
 * @since 2021-03-31
 */
@RestController
@AllArgsConstructor
@RequestMapping("/petsWebInfo")
public class PetsWebInfoController {

    private IPetsWebInfoService service;

    /**
     * 找到最新数据
     */
    @GetMapping("/latestInfo")
    public R<WebInfoVO> latestInfo(){

        return R.ok(service.latestInfo());
    }

    /**
     *  修改
     * @param petsWebInfo
     */
    @PostMapping("/submit")
    public R<Boolean> submit(@RequestBody PetsWebInfo petsWebInfo){
        return R.ok(service.submit(petsWebInfo));
    }

}
